<include file="public@header"/>
<link rel="stylesheet" href="__TMPL__/public/assets/css/animation.css">

</head>
<body>

<div class="layui-fluid">
    <div class="layui-row">

        <div class="layui-page-header">
            <div class="layui-card">
                <div class="layui-page-header-content">
                    <div class="layui-card-body">
                        <div class="layui-ui-page-header-title" >
                            分站管理员列表
                        </div>
                    </div>
                    <div class="layui-tab layui-tab-brief">
                        <ul class="layui-tab-title layui-nav" id="tabHeader">
                            <li class="layui-this layui-nav-item"><a>列表</a></li>
                            <li class="layui-nav-item"><a href="{:url('substation/add')}">{:lang('ADD')}</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-page-content">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form class="layui-form" method="get" action="{:url('substation/index')}">
                        <div class="layui-form-item layuiadmin-card-text" style="margin-bottom: 0;">
                            <div class="layui-inline">
                                <label class="layui-form-label">禁用</label>
                                <div class="layui-input-inline">
                                    <select class="layui-input" name="isban">
                                        <option value="">全部</option>
                                        <option value="1" <if condition="input('request.isban') neq '' && input('request.isban') eq 1">selected</if>>是</option>
                                        <option value="0" <if condition="input('request.isban') neq '' && input('request.isban') eq 0">selected</if>>否</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">注册时间</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input js-bootstrap-date" name="start_time"
                                           value="{:input('request.start_time')}"
                                           autocomplete="off" placeholder="开始日期">
                                </div>
                                <div class="layui-form-mid">-</div>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input js-bootstrap-date" name="end_time"
                                           value="{:input('request.end_time')}"
                                           autocomplete="off" placeholder="结束日期">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">用户ID</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" name="uid" value="{:input('request.uid')}" placeholder="请输入用户ID">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">关键字</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" name="keyword" value="{:input('request.keyword')}" placeholder="请输入关键字">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-inline">
                                    <input type="submit" class="layui-btn btn-primary" value="搜索" />
                                    <a class="layui-btn layui-btn-danger btn-danger" href="{:url('substation/index')}">清空</a>
                                </div>
                            </div>
                            <br>
                            用户数：{$nums}  (根据条件统计)
                        </div>
                    </form>
                </div>
            </div>
        </div>

        <div class="layui-page-content">
            <div class="layui-card">
                <div class="layui-card-body">
                    <table class="layui-table" lay-even lay-size="lg">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>账号</th>
                            <th>昵称</th>
                            <th>头像</th>
                            <th>手机</th>
                            <th>骑手数量</th>
                            <th>注册时间</th>
                            <th>{:lang('STATUS')}</th>
                            <th>{:lang('ACTIONS')}</th>
                        </tr>
                        </thead>
                        <tbody>
                        <php>$user_statuses=array("0"=>lang('USER_STATUS_BLOCKED'),"1"=>lang('USER_STATUS_ACTIVATED'),"2"=>lang('USER_STATUS_UNVERIFIED'));</php>
                        <foreach name="list" item="vo">
                            <tr>

                                <td>{$vo.id}</td>
                                <td>{$vo['user_login']?$vo['user_login']:($vo['mobile']?$vo['mobile']:lang('THIRD_PARTY_USER'))}
                                </td>
                                <td>{$vo['user_nickname'] ? $vo['user_nickname'] : '暂无'}</td>
                                <td><img src="{$vo['avatar']}"/></td>
                                <td>{$vo.mobile}</td>
                                <td>{$vo.rnums}</td>
                                <td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
                                <td>
                                    <switch name="vo.user_status">
                                        <case value="0">
                                            <span class="layui-badge-dot layui-bg-abnormal" style="margin-right: 6px;"></span>{$user_statuses[$vo['user_status']]}
                                        </case>
                                        <case value="1">
                                            <span class="layui-badge-dot layui-bg-function" style="margin-right: 6px;"></span>{$user_statuses[$vo['user_status']]}
                                        </case>
                                    </switch>
                                </td>
                                <td>
                                    <if condition="$vo['user_status'] eq 1">
                                        <a class="layui-bo layui-bo-small layui-btn-warm js-ajax-dialog-btn" href="{:url('substation/ban',array('id'=>$vo['id']))}" data-msg="{:lang('BLOCK_USER_CONFIRM_MESSAGE')}">{:lang('BLOCK_USER')}</a>
                                    <else />
                                        <a class="layui-bo layui-bo-small layui-bo-succes js-ajax-dialog-btn" href="{:url('substation/cancelban',array('id'=>$vo['id']))}" data-msg="{:lang('ACTIVATE_USER_CONFIRM_MESSAGE')}">{:lang('ACTIVATE_USER')}</a>
                                    </if>

                                    <a class="layui-bo layui-bo-small layui-bo-checked" href="{:url('substation/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
<!--                                    <a class="layui-bo layui-bo-small layui-bo-close js-ajax-delete" href="{:url('substation/del',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>-->
                                </td>
                            </tr>
                        </foreach>
                        </tbody>
                    </table>
                    <div class="pagination">{$page}</div>
                </div>
            </div>
        </div>
    </div>
</div>

<include file="public@script"/>
</body>
</html>